#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
string s;
int pos;
struct Node {
  int mx[2], mn[2];
};
Node dfs() {
  Node res;
  res.mx[1] = res.mn[1] = 1;
  res.mx[0] = res.mn[0] = 0;
  int cnt = s[pos++] - '0';
  Node x = Node{0, 0, 0, 0};
  Node y = Node{0, 0, 0, 0};
  if (cnt) x = dfs();
  if (cnt == 2) y = dfs();
  res.mx[1] += x.mx[0] + y.mx[0];
  res.mn[1] += x.mn[0] + y.mn[0];
  res.mx[0] += max(x.mx[0] + y.mx[1], x.mx[1] + y.mx[0]);
  res.mn[0] += min(x.mn[0] + y.mn[1], x.mn[1] + y.mn[0]);
  return res;
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> s;
  Node res = dfs();
  cout << max(res.mx[0], res.mx[1]) << ' ' << min(res.mn[0], res.mn[1]);
  return 0;
}